<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../../print.css" type="text/css" media="print">
<meta content="Queue,com.developmentarc.framework.datastructures.utils.Queue,FIFO,LIFO,hasItems,length,add,addAt,last,next,remove,removeAll,removeAt" name="keywords">
<title>com.developmentarc.framework.datastructures.utils.Queue</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'Queue - DevelopmentArc Core API Documentation';
				var baseRef = '../../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">DevelopmentArc Core API</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../../all-classes.html')" href="../../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../../all-classes.html')" href="../../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../../index-list.html')" href="../../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../../index.html?com/developmentarc/framework/datastructures/utils/Queue.html&amp;com/developmentarc/framework/datastructures/utils/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;Queue</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a>&nbsp;| <a href="#constantSummary">Constants</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class Queue"); titleBar_setSubNav(true,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">com.developmentarc.framework.datastructures.utils</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class Queue</td>
</tr>
</table>
<p></p>
  The Queue is a datastructure that allows items to be added
  in a specified order then retrived by calling the next() method.
  The Queue is defined as either "First in First Out" (FIFO) or
  "Last in First Out" (LIFO).  A FIFO structure removes items in
  the order they were added, the first item added will be the first
  item returned when next() is called.  A LIFO strucutre returns
  the last item added when next() is called.
  
  <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#hasItems">hasItems</a> : Boolean<div class="summaryTableDescription">[read-only]
   Used to determine if items are currently stored inside the
   Queue.</div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#length">length</a> : int<div class="summaryTableDescription">[read-only]
   The number of items currently in the Queue.</div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#Queue()">Queue</a>(direction:String)</div>
<div class="summaryTableDescription">
   Creates a new Queue passing in the direction of Queue.</div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#add()">add</a>(item:*):void</div>
<div class="summaryTableDescription">
   Adds an item to the Queue.</div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addAt()">addAt</a>(item:*, position:int = -1):void</div>
<div class="summaryTableDescription">
   Adds an item to the Queue at the location specified.</div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#last()">last</a>():*</div>
<div class="summaryTableDescription">
   This method is used to access the last item in the Queue
   depending upon the direction of the Queue.</div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#next()">next</a>():*</div>
<div class="summaryTableDescription">
   This method is used to access the next item in the Queue
   depending upon the direction of the Queue.</div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#remove()">remove</a>(item:*, numberOfItems:int):void</div>
<div class="summaryTableDescription">
   Removes the specfied item from the queue.</div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeAll()">removeAll</a>():void</div>
<div class="summaryTableDescription">
   Removes all items from the queue.</div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeAt()">removeAt</a>(position:int):Boolean</div>
<div class="summaryTableDescription">
   Removes an item at the specified position.</div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
</table>
</div>
<a name="constantSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Constants</div>
<table id="summaryTableConstant" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Constant</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#FIFO">FIFO</a> : String = "FIFO"<div class="summaryTableDescription">[static]</div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#LIFO">LIFO</a> : String = "LIFO"<div class="summaryTableDescription">[static]</div>
</td><td class="summaryTableOwnerCol">Queue</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="hasItems"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">hasItems</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>hasItems:Boolean</code>&nbsp;&nbsp;[read-only]<p>
   Used to determine if items are currently stored inside the
   Queue.
    
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get hasItems():Boolean</code>
<br>
</div>
<a name="length"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">length</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>length:int</code>&nbsp;&nbsp;[read-only]<p>
   The number of items currently in the Queue.
    
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get length():int</code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="Queue()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">Queue</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function Queue(direction:String)</code><p>
   Creates a new Queue passing in the direction of Queue.
   The default direction is FIFO, accepted values are FIFO
   and LIFO.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">direction</span>:String</code> &mdash; The order items are removed by the nex() call.
   
   </td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="add()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">add</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function add(item:*):void</code><p>
   Adds an item to the Queue.  The order the items are added
   to the queue is important because this determines the order
   they are removed when next() is called.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">item</span>:*</code> &mdash; The item to add to the end of the Queue.
   
   </td>
</tr>
</table>
</div>
<a name="addAt()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addAt</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function addAt(item:*, position:int = -1):void</code><p>
   Adds an item to the Queue at the location specified.  If the value
   is less then zero the item is put at the beginning of the queue. If
   the value is equal to or greater then the length of the Queue then
   the item is put at the end of the Queue.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">item</span>:*</code> &mdash; The item to add to the Queue.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">position</span>:int</code> (default = <code>-1</code>)<code></code> &mdash; The position to place the item at.
   
   </td>
</tr>
</table>
</div>
<a name="last()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">last</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function last():*</code><p>
   This method is used to access the last item in the Queue
   depending upon the direction of the Queue.  If the Queue
   is typed FIFO (default) the last item in the Queue, i.e.
   length -1, is returned.  If the the Queue is typed LIFO
   then the first item in the queue, i.e. position 0, 
   is returned.
    
   </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>*</code> &mdash; The last item in the Queue dependent upon the direction.
   
   </td>
</tr>
</table>
</div>
<a name="next()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">next</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function next():*</code><p>
   This method is used to access the next item in the Queue
   depending upon the direction of the Queue.  If the Queue
   is typed FIFO (default) the first item in the Queue, i.e.
   position 0, is returned.  If the the Queue is typed LIFO
   then the last item in the queue, i.e. position length -1, 
   is returned.
    
   </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>*</code> &mdash; The next item in the Queue dependent upon the direction.
   
   </td>
</tr>
</table>
</div>
<a name="remove()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">remove</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function remove(item:*, numberOfItems:int):void</code><p>
   Removes the specfied item from the queue.  If the item is in the
   Queue more then one time then the numberOfItems value is used to
   determine how many of the repeated items should be remove.  The
   default is all items are removed from the queue.  Passing 1 or more
   will then determine how many times the item is removed.
   
   </p><p>The order items are removed depends on the direction of the the
   Queue.  If the Queue is FIFO then the removal starts at the beginning
   of the Queue to find items to remove.  If the Queue is LIFO the method
   starts at the end of the Queue and works forward.</p>
    
   <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">item</span>:*</code> &mdash; The item to find and remove.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">numberOfItems</span>:int</code> &mdash; The number of instances of the item to remove.
   
   </td>
</tr>
</table>
</div>
<a name="removeAll()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeAll</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function removeAll():void</code><p>
   Removes all items from the queue. 
   
   </p></div>
<a name="removeAt()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeAt</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function removeAt(position:int):Boolean</code><p>
   Removes an item at the specified position.  If the position
   is invalid then a false value is returned stating that the item
   was not removed at the provided position.  If the position is valid
   the method returns a true for success.
    
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">position</span>:int</code> &mdash; The position in the Queue to remove.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Boolean</code> &mdash; True for successful removal, false for an invalid position.
   
   </td>
</tr>
</table>
</div>
<a name="constantDetail"></a>
<div class="detailSectionHeader">Constant detail</div>
<a name="FIFO"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">FIFO</td><td class="detailHeaderType">constant</td>
</tr>
</table>
<div class="detailBody">
<code>public static const FIFO:String = "FIFO"</code>
</div>
<a name="LIFO"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">LIFO</td><td class="detailHeaderType">constant</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static const LIFO:String = "LIFO"</code>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
